<%-- 
    Document   : view-kecelakaan-kerja-data
    Created on : 09 Sep 11, 15:21:28
    Author     : Bayu
--%>

<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-type" value="text/html; charset=UTF-8" />
        <jsp:include page="includes/script.html"/>

        <title>K3 Data</title>
    </head>
    <body>

        <h2 align="center">Data Kecelakaan Kerja Tahunan</h2>

        <br>
        <center>
            ${msg}
        <form method="get">
<select name="year">
                          <c:forEach var="i" begin="${minYear}" end="${maxYear}">
                               <c:choose>
                                <c:when test="${currentYear == i}">
                                    <c:set var="select" value="selected"></c:set>
                                </c:when>
                                <c:otherwise>
                                    <c:set var="select" value=""></c:set>
                                </c:otherwise>
                               </c:choose>
                              <option value="${i}" ${select}>${i}</option>
                          </c:forEach>
                        </select>
               <input  type="submit" name="submit" value="View" >

        </form>

               <br>
        <table cellpading="1" cellspacing="1" bgcolor="#010101" align="center" width="800">
            <tr bgcolor="#c2c3c4" align="center">
                            <td width="20%">Bulan</td>
                            <td width="20%">Total</td>
                            <td width="10%">Action</td>

                        </tr>

                        <c:forEach items="${data}" var="data">
                            

                            <tr bgcolor="#f2f3f4">

                                <td><fmt:formatDate pattern="MMM yyyy" value="${data.month}" /></td>
                            

                            <td>${data.total}</td>
                            

                            <td>
                                <a href="kecelakaan-kerja-update.htm?id=${data.id}">Edit</a>&nbsp;
                                <a href="view-kecelakaan-kerja-data.htm?id=${data.id}">Delete</a>&nbsp;
                            </td>

                        </tr>
                        </c:forEach>

                </table>

        </center>
    </body>
</html>
